import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

Vue.directive('mode', {
  bind(el, binding) {
    el.value = binding.value
  },
  inserted(el, binding, vnode) {
    el.addEventListener('input', (e) => {
      // console.log(e)
      vnode.context[binding.expression] = e.target.value
      // console.log(vnode.context)
      // console.log(vnode)
      // console.log(binding)
    })
  },
  update(el, binding, vnode) {
    el.value = binding.value
  },
})

new Vue({
  render: (h) => h(App),
}).$mount('#app')
